package util;

import graph.IdManager;
import graph.PropertyManager;

import java.io.File;

import search.TwitterSearcher;


public class Common {
	public static File dataDir = new File("../data");
	public static File serviceOutputFile = new File("../data/service.out");
	
	public static File getGlobalSortFile(Object o){
		return new File(dataDir + "/" + o.toString() + ".dat");
	}
	
	public static File indexDir(){
		return new File(dataDir + "/index");
	}
	
	public static File databaseDir(){
		return new File(dataDir + "/database");
	}
	
	public static File propertyFile(String propertyName){
		return new File(databaseDir() + "/" + propertyName + ".prop");
	}

	public static PropertyManager getPropertyManager(String name) {
		return PropertyManager.load(propertyFile(name));
	}

	public static IdManager getIdManager(String name) {
		return IdManager.getIdManager(databaseDir().toString(), name);
	}
	
	public static TwitterSearcher getSearcher(){
		TwitterSearcher searcher = new TwitterSearcher(new File("../data/index/"));
		return searcher;
	}
}
